Data sharing

ABSTRACT

Embodiments of the present invention may share common data among multiple servers. According to one embodiment of the present invention, a code segment is obtained at a first server from a client in response to the client interacting with a first application hosted on the first server, where the code segment is associated with business logic in the first application. Then, the first application is executed based on the code segment.

BACKGROUND

With developments of computer and network technologies, online servicesnow provide great support in every aspect of people's life. In manyindustries, more and more service providers begin to provide onlineservices via Web applications in their websites, and thus users canaccess to these online services via network instead of visiting theproviders' offices personally.

The online services cover multiple aspect of the service provider andare usually supported by different Web application. For example, for atelecommunication provider, there may be separate Web applications foruser management, credit management and the like. Although these Webapplications are integrated into one website, these Web applications areusually developed by different software companies and possibly writtenin different programming languages. For example, the Web application foruser management on Server A is written in Java™ by Company A, and theWeb application for credit management on Server B is written in C++ byCompany B. As both of these Web applications follow the business logicin the telecommunication company, these Web applications are possiblydependent if common business logic is shared between these Webapplications. When the common business logic changes, additional timeand effort are required for the engineers in each of Companies A and Bso as to modify the code in each Web applications.

SUMMARY

In one aspect of the present invention, a computer-implemented method isproposed. According to the method, a code segment is obtained at a firstserver from a client in response to the client interacting with a firstapplication hosted on the first server, where the code segment isassociated with business logic in the first application. Then, the firstapplication is executed based on the code segment.

In another aspect of the present invention, a computing system isproposed. The computing system comprises a computer processor coupled toa computer-readable memory unit, the memory unit comprises instructionsthat when executed by the computer processor implements a method. In themethod, a code segment is obtained at a first server from a client inresponse to the client interacting with a first application hosted onthe first server, where the code segment is associated with businesslogic in the first application. Then, the first application is executedbased on the code segment.

In yet another aspect of the present invention, a computer programproduct is proposed. The computer program product is tangibly stored ona non-transient machine readable medium and comprises executableinstructions which, when executed on an electronic device, cause theelectronic device to: obtain, at a first server, a code segment from aclient in response to the client interacting with a first applicationhosted on the first server, the code segment being associated withbusiness logic in the first application; and execute the firstapplication based on the code segment.

It is to be understood that the summary is not intended to identify keyor essential features of embodiments of the present invention, nor is itintended to be used to limit the scope of the present invention. Otherfeatures of the present invention will become easily comprehensiblethrough the description below.

BRIEF DESCRIPTION OF THE DRAWINGS

Through the more detailed description of some embodiments of the presentdisclosure in the accompanying drawings, the above and other objects,features and advantages of the present disclosure will become moreapparent, wherein:

FIG. 1 schematically illustrates an example computer system/server 12which is applicable to implement embodiments of the present invention;

FIG. 2 schematically illustrates a network environment according to oneembodiment of the present invention;

FIG. 3 schematically illustrates a block diagram for generating andsharing a code segment associated with business logic for an applicationaccording to one embodiment of the present invention;

FIG. 4 schematically illustrates a diagram for sharing code segmentbetween multiple servers according to one embodiment of the presentinvention;

FIG. 5 schematically illustrates a flowchart of a method for sharingcode segment according to one embodiment of the present invention;

FIG. 6 schematically illustrates a dialog for generating a code segmentaccording to one embodiment of the present invention;

FIG. 7 schematically illustrates a flowchart of a method for sharingcode segment according to another embodiment of the present invention;and

FIG. 8 schematically illustrates a flowchart of a method for sharingcode segment according to one embodiment of the present invention.

Throughout the drawings, same or similar reference numerals representthe same or similar elements.

DETAILED DESCRIPTION

Principle of the present invention will now be described with referenceto some example embodiments. It is to be understood that theseembodiments are described only for the purpose of illustration and helpthose skilled in the art to understand and implement the presentinvention, without suggesting any limitations as to the scope of theinvention. The invention described herein can be implemented in variousmanners other than the ones describe below.

As used herein, the term “includes” and its variants are to be read asopen terms that mean “includes, but is not limited to.” The term “basedon” is to be read as “based at least in part on.” The term “oneembodiment” and “an embodiment” are to be read as “at least oneembodiment.” The term “another embodiment” is to be read as “at leastone other embodiment.” Other definitions, explicit and implicit, may beincluded below.

Reference is first made to FIG. 1, in which an example electronic deviceor computer system/server 12 which is applicable to implement theembodiments of the present invention is shown. Computer system/server 12is only illustrative and is not intended to suggest any limitation as tothe scope of use or functionality of embodiments of the inventiondescribed herein.

As shown in FIG. 1, computer system/server 12 is shown in the form of ageneral-purpose computing device. The components of computersystem/server 12 may include, but are not limited to, one or moreprocessors or processing units 16, a system memory 28, and a bus 18 thatcouples various system components including system memory 28 toprocessor 16.

Bus 18 represents one or more of any of several types of bus structures,including a memory bus or memory controller, a peripheral bus, anaccelerated graphics port, and a processor or local bus using any of avariety of bus architectures. By way of example, and not limitation,such architectures include Industry Standard Architecture (ISA) bus,Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, VideoElectronics Standards Association (VESA) local bus, and PeripheralComponent Interconnect (PCI) bus.

Computer system/server 12 typically includes a variety of computersystem readable media. Such media may be any available media that isaccessible by computer system/server 12, and it includes both volatileand non-volatile media, removable and non-removable media.

System memory 28 can include computer system readable media in the formof volatile memory, such as random access memory (RAM) 30 and/or cachememory 32. Computer system/server 12 may further include otherremovable/non-removable, volatile/non-volatile computer system storagemedia. By way of example only, storage system 34 can be provided forreading from and writing to a non-removable, non-volatile magnetic media(not shown and typically called a “hard drive”). Although not shown, amagnetic disk drive for reading from and writing to a removable,non-volatile magnetic disk (e.g., a “floppy disk”), and an optical diskdrive for reading from or writing to a removable, non-volatile opticaldisk such as a CD-ROM, DVD-ROM or other optical media can be provided.In such instances, each can be connected to bus 18 by one or more datamedia interfaces. As will be further depicted and described below,memory 28 may include at least one program product having a set (e.g.,at least one) of program modules that are configured to carry out thefunctions of embodiments of the invention.

Program/utility 40, having a set (at least one) of program modules 42,may be stored in memory 28 by way of example, and not limitation, aswell as an operating system, one or more application programs, otherprogram modules, and program data. Each of the operating system, one ormore application programs, other program modules, and program data orsome combination thereof, may include an implementation of a networkingenvironment. Program modules 42 generally carry out the functions and/ormethodologies of embodiments of the invention as described herein.

Computer system/server 12 may also communicate with one or more externaldevices 14 such as a keyboard, a pointing device, a display 24, and thelike. One or more devices that enable a user to interact with computersystem/server 12; and/or any devices (e.g., network card, modem, etc.)that enable computer system/server 12 to communicate with one or moreother computing devices. Such communication can occur via Input/Output(I/O) interfaces 22. Still yet, computer system/server 12 cancommunicate with one or more networks such as a local area network(LAN), a general wide area network (WAN), and/or a public network (e.g.,the Internet) via network adapter 20. As depicted, network adapter 20communicates with the other components of computer system/server 12 viabus 18. It should be understood that although not shown, other hardwareand/or software components could be used in conjunction with computersystem/server 12. Examples, include, but are not limited to: microcode,device drivers, redundant processing units, external disk drive arrays,RAID systems, tape drives, and data archival storage systems, etc.

It would be appreciated that the computer system/server 12 illustratedin FIG. 1 is only an example for implementing one embodiment of thepresent invention. In another embodiment of the present invention, othercomputing devices may be adopted, for example, the data sharing may beimplemented at any of the servers that host the Web application.

FIG. 2 schematically illustrates a network environment according to oneembodiment of the present invention. A website 250 includes a server 210and a server 220. In this figure, an application 212 is hosted on theserver 210 and an application 222 is hosted on the server 220. Further,the clients such as a client 240, and client 242 access the applicationshosted on different servers via a network 230. In this environment, ifcommon data is shared between the applications 212 and 222, thenadditional effort is required to manage the distribution of the commondata.

For example, the application 212 for user management is written in JAVA™by Company A, and the application 222 for credit management is writtenin C++ by Company B. Usually, the common business logic is sharedbetween applications 212 and 222. For example, the business logic forchecking whether the age of a user is greater than a threshold such as20 is shared. According to the prior art approach, if thetelecommunication changes the threshold in the business logic, thenCompanies A and B have to rewrite the code segment in the application212 and application 222 respectively.

According to one proposed approach, the common business logic isextracted from the applications. Then, a central service is setup fordistributing the common business logic to various applicationsassociated with the common logic. In this approach, the central serviceshould ensure that the common logic is distributed to all the associatedapplications and that the common logic at all the associatedapplications is consistent. Although this approach is beneficial inmanaging complex business logic, it is an expensive and time-consumingprocedure for sharing the light business logic such as checking theuser's age. If the light business logic is shared among multipleapplications according to the above approach, heavy workloads may becaused to the central service.

In view of the above, it is desired to provide a convenient and simpleapproach for sharing light business logic among multiple applications.According to one embodiment of the present invention, code segmentrelated to the common business logic is not directly written in theapplication. Instead, the code related to the common business logic isdefined as a separated code segment external to the application. Duringthe operation of the application, the code segment is invoked byexecuting the application. FIG. 3 schematically illustrates a blockdiagram for generating and sharing a code segment associated withbusiness logic for an application according to one embodiment of thepresent invention.

As illustrated in FIG. 3, an application 310 including a function 312 iswritten in Java™, and an application 320 including a function 322 iswritten in C++. The functions 312 and 322 are associated with the commonbusiness logic 330, and these functions act as portals for invoking thecode segment 340, respectively. In one embodiment of the presentinvention, the code segment 340 is shared between the applications 310and 320 such that the applications 310 and 320 call the functions 312and 322 respectively in running these two applications. As the codesegment 340 records the code for the common business logic, distributingthe code segment 340 to each of the applications 310 and 320 will ensurethat each of the applications implements the common business logic.

Although each of the applications illustrated in FIG. 3 includes onlyone function (for example, the application 310 includes the function 312and the application 320 includes the function 322), in another example,the application may include multiple functions associated with differentbusiness logic. For example, the application 310 may include a furtherfunction 312 and the application 320 may include a further function 322(not illustrated in FIG. 3), where the functions 312 and 322 may share afurther business logic.

For example, if both of the applications 310 and 320 call the commonbusiness logic for removing all the white spaces in a user input stringand converting the string into lower case, then a common code segment asillustrated in Table 1 may be coded. Although the example code segmentis written in Java™ script, other programming languages may be used inanother embodiment.

TABLE 1 Example Code Segment function normalize_input(input){  var str =input.replace(/ /g,″);  return str.toLowerCase( ); }

In another example, if the common business logic relates to displayingan additional message on the browser for customers who are located inCity A, then the code segment may be defined as illustrated in Table 2.

TABLE 2 Example Code Segment function getWelcomeMessage(customer) {  if(customer.getLocation == ‘City A’) {  message = ‘New product ABC is nowavailable for City A!’  return message; }

FIG. 4 schematically illustrates a diagram for sharing code segmentbetween multiple servers according to one embodiment of the presentinvention. According to one embodiment of the present application, acode segment is obtained (422) at a first server 410 from a client 420in response to the client 420 interacting with a first application 412hosted on the first server 410, where the code segment is associatedwith business logic in the first application 412. Then, the firstapplication 412 is executed (422) based on the obtained code segment.Accordingly, the code segment may be distributed to multiple serversupon the client accessing one of the multiple servers such as server430.

In this embodiment, the code segment associated with the business logicof the first application is provided in a client in advance, and thenthe code segment is transmitted from the client to the first server whenthe client is interacting with the first server. As the online servicesof the website are implemented by multiple applications hosted onmultiple servers, when the client accesses the website, based on theorganization of the website, actually the client is interacting with themultiple servers included in the website. Accordingly, the code segmentprovided on the client will be distributed to the multiple servers uponthe client accessing one of the multiple servers. Compared to thetraditional approach of additionally providing the central service fordistributing the code segment to the multiple servers, code segment isshared to multiple servers of the website via the client according tothe present invention.

FIG. 5 schematically illustrates a flowchart of a method for sharingcode segment according to one embodiment of the present invention. InStep 510, a code segment is obtained at a first server from a client inresponse to the client interacting with a first application hosted onthe first server, where the code segment is associated with businesslogic of the first application. In this step, the code segment is inadvance provided to the client, and the present embodiment does not careabout how to provide the code segment to the client. For example, thecode segment may be obtained from another server, or generated at theclient.

In Step 520, the first application is executed based on the codesegment. In this step, the code segment is called by the firstapplication. The code segment is interpreted into executable codetogether with the code of the first application.

In one embodiment of the present invention, the first server may beassociated with a domain of a first Hyper Text Transport Protocol (HTTP)cookie, and the code segment may be received at the first server via thefirst HTTP cookie. In this embodiment, the code segment is encoded intothe HTTP cookie and the cookie is automatically carried from the clientto the first server during an interaction according to HTTP. In otherwords, once the code segment is encoded into the cookie, the cookie istreated as a common HTTP cookie. As all the subsequent operationsperformed to the cookie follow the specifications defined in HTTP, noextra workloads are required in distributing the code segment to anotherserver.

Usually, hundreds of or even thousands of clients access the multipleservers of the website at every moment. Once the code segment isprovided to one client, the cookie encoded with the code segment will beimmediately transmitted to other servers of the website along with theHTTP communication between the client and the other servers.

Single sign-on (SSO) is a popular technique adopted in the design of thewebsite. SSO provides a property of access control of multiple related,but independent software systems. In the embodiments of the presentinvention, the multiple servers of the website may be considered asrelated but independent software systems. With SSO, once a client logsin one server of the website, this client gains access to all serverswithout being prompted to a login interface when accessing each of theservers. As the domain of the cookie is associated with the loginhierarchy of the website, the domain of the cookie may be considered inthe embodiments of the present invention so as to accelerate thedistribution of the cookies.

In one embodiment of the present invention, the code segment may bereceived from the client in response to the first server beingassociated with the domain of the first HTTP cookie. For example, thewebsite includes a first server and a second server. The domain of thewebsite may be represented as “www.xyz.com,” and the domains of thefirst and second servers may be represented as “a.xyz.com” and“b.xyz.com,” respectively. If the website supports SSO, then the clientlogged in the first server is automatically permitted to access thesecond server, vice visa.

According to HTTP, if the domain of a receiving server domain isassociated with the domain of the domain of a HTTP cookie (for example,in the peer domain or sub-domain), then the client will automaticallysend the HTTP cookie to the receiving server. In this embodiment, thedomain of the first server is a sub-domain, thus the first HTTP cookieis automatically sent from the client to the first server. Accordingly,the code segment carried in the first HTTP cookie is received at thefirst server.

At this point, if the client on which the code segment is locatedaccesses the first server according to HTTP, then the code segment istransmitted from the client to the first server. Further, as the websitesupports SSO, the client is automatically permitted to access the secondserver, and thus the cookie is automatically transmitted to the secondserver. Accordingly, the code is transmitted from the client to thesecond.

In one embodiment of the present invention, the code segment may beencoded into a second HTTP cookie by the second server, and then thecode segment may be received by the client from a second HTTP cookieduring an interaction between the client and the second server.

Various encoding algorithms may be adopted in encoding the code segmentinto the cookie. For example, Base64 encoding schemes may be adopted.Base64 is a group of similar binary-to-text encoding schemes thatrepresent binary data in an ASCII string format by translating it into aradix-64 representation. Base64 encoding schemes are commonly used wherethere is a need to encode binary data that needs to be stored andtransferred over media that is designed to deal with textual data. Base64 encoding ensures that the data remains intact without modificationduring transport. Referring back to Table 1, the code segment may beencoded to a string as illustrated in Table 3. Although Base64 is takenas an example encoding algorithm in describing the embodiment, anotherappropriate algorithm may be adopted as long as it may encode the codesegment into the cookie.

TABLE 3 Encoded StringZnVuY3Rpb24gbm9ybWFsaXplX2lucHV0KGlucHV0KXsNCiAgICB2YXIgc3RyID0gaW5wdXQucmVwbGFjZSgvIC9nLCcnKTsNCiAgICByZXR1cm4gc3RyLnRvTG93ZXJDYXNlKCk7DQp9DQo=

Reference is made to FIG. 6 to further describe how to load the Base64string into the HTTP cookie. FIG. 6 schematically illustrates a dialogfor generating a code segment according to one embodiment of the presentinvention. A dialog 600 illustrates a tool for editing the cookie. Inthe dialog 600, the name of the cookie (for example, “sharedcode”) maybe defined in a name field 610, and the encoded string illustrated inTable 3 may be input into the value field 620.

Although “sharedcode” is illustrated in FIG. 6 as an example name,another name may be defined in the dialog 600. For example, another name“sharedcode2” may be input in the name field 610 to load another Base64string. Further, the example code segment in Table 2 may be encoded intoanother string, and then the other string may be input in the valuefield 620.

In one embodiment of the present invention, the code segment may bereceived via a second HTTP cookie by the client from a second serverthat hosts a second application, and business logic of the secondapplication may be identical to the business logic of the firstapplication. With this embodiment, the code segment may be provided tothe client from one of the servers of the website, then the code segmentmay be transmitted to the first server which has the same business logicas that of the one provided with the code segment. Compared with theconventional approach, no central service is setup for distributing thecode segment among the multiple servers of the website. Instead, thecode segment associated with the common business logic is distributed tothe servers via the client.

In one embodiment of the present invention, executable code may begenerated by interpreting the obtained code segment. Then, theexecutable code may be invoked at the first server in response to thefirst application being executed. As the code segment is encoded intothe string and inserted in the cookie obtained to the first server, thestring needs to be decoded to recover the original code segment forfurther processing. Example code called at the first server isillustrated in Table 4.

TABLE 4 Example Code String code = getCookieByName (“sharedcode”); // toread cookie whose name is ‘sharedcode’ code = base64Decode(code); // todecode the base64 string Customer cust = getCurrentUser( ); // to getcurrent log in user object; String message = runScriptFromCookie (code,convertCustomerObject (cust)); // to run the Javascript code extractedfrom cookie, // using Javascript engine from server side

Based on above example code, the string encoded in the cookie may beextracted from the cookie by a function getCookieByName (“sharedcode”),and then the string is decoded back to the code segment. The decodingstep is an inverse operation of the encoding step, and it converts thestring as illustrated in Table 3 back to the code segment as illustratedin Table 1. Next, the code segment may be run by a Java′ script engineat the first server in running the first application.

In one embodiment of the present invention, the code segment may befurther sent to a second client at the first sever. As described in theabove, embodiments of the present invention take advantage of theroutine HTTP communication between the client and multiple servers ofthe website. Specifically, the code segment is encoded in the cookiethat is to be transmitted to and from the client and multiple servers.Accordingly, the common business logic may be distributed among themultiple servers without dedicated communication for sharing the commonbusiness logic.

In one embodiment of the present invention, the code segment may beencoded into a third HTTP cookie. Then, the third HTTP cookie may besent to the second client.

In this embodiment, the code segment associated with the common businesslogic is encoded into the HTTP cookie and thus is distributed amongmultiple servers with the spread of the HTTP cookie. It would beappreciated that transmitting the cookie between the clients and theserver is automatically implemented according to HTTP, thereby causingno additional workloads to the client and the servers. In thisembodiment, once the code segment is received on the first server, itmay be automatically sent to another client connected with the firstserver. Further, the code segment encoded in the cookie may bepropagated with the spread of the cookie in response to an HTTPcommunication between the other client and another server. With theabove procedure, the code segment associated with the common businesslogic is quickly distributed among the multiple servers of the website.

In one embodiment of the present invention, the code segment may beupdated at the first server in response to a change in the businesslogic of the first application. Then, the updated code segment may besent to the client. As the code segment associated with the commonbusiness logic is external to the applications on the multiple servers,the code segment may be easily modified when the business logic ischanged.

If the common business logic changes, the code segment will be updated.The updating step may be implemented at any of the servers of thewebsite or at another computing node, as long as the updated codesegment may be provided to the client and/or one of the servers. Oncethe code segment is updated, the updated code segment may be provided toa client. At this point, the updated code segment at the client may becarried in the cookie and distributed to another server. Alternatively,the updated code segment may be provided to a server, and then theupdated code segment may be carried in the cookie and then transmittedto a client. In turn, the updated code segment at the client may bedistributed to other servers.

Referring back to Table 2, if the content of the additional messagedisplayed on the browser changes (for example, the message changes to“New product XYZ is now available for City A!”), then the updated codesegment is illustrated in Table 4.

TABLE 4 Example Code Segment function getWelcomeMessage(customer) {  if(customer.getLocation == ‘City A’) {  message = ‘New product XYZ is nowavailable for City A!’  return message; }

Then the updated code segment may be encoded into an HTTP cookie andthen sent to a client according to an HTTP communication between theclient and the first server.

FIG. 7 schematically illustrates a flowchart of a method for sharingcode segment according to another embodiment of the present invention.In Step 710, a code segment associated with business logic of a secondapplication is generated at the second server, where the secondapplication is hosted on the second server. Referring back to Tables 1and 2, the code segment as illustrated in Tables 1 and 2 may begenerated. In Step 720, the code segment is caused to be sent to a firstserver that hosts a first application, where business logic of the firstapplication being identical to the business logic of the secondapplication. In this step, the code segment is transmitted via theclient from the first server to another server of the website.

In one embodiment of the present invention, the code segment may beencoded into a HTTP cookie. Then, the cookie may be caused to be sent tothe first server via the client. The encoding step is similar to theprocedure described with reference to FIG. 6, and details are omittedherein.

In one embodiment of the present invention, the code segment may beupdated in response to a change occurring in the business logic of thesecond application. Then, the updated segment may be caused to be sentto the first server via the client.

In one embodiment of the present invention, a third code segment may beobtained at the second server from a client in response to the clientinteracting with the second application. In this embodiment, the thirdcode segment may be associated with business logic of the secondapplication. Then, the second application may be executed based on thethird code segment.

FIG. 8 schematically illustrates a flowchart of a method for sharingcode segment according to one embodiment of the present invention. InStep 810, a code segment associated with business logic of a firstapplication being hosted on the first server is sent to a client. InStep 820, the code segment is obtained at the first server from theclient in response to the client being interacting with a firstapplication hosted on the first server. In Step 830, the firstapplication is executed based on the code segment.

Referring back to FIG. 2, the applications 212 and 222 share the commonbusiness logic, and the code segment associated with the common businesslogic is generated. In this example, the code segment is generated atthe server 210, or the code segment is generated at another computingdevice and then provided to the server 210. At this point, if theapplication 212 is accessed, then the application 212 is executed basedon the code segment on the server 210. Then, during the interactionbetween the client 240 and the server 210, the code segment is sent tothe client 240 from the server 210 via the network 230. At this point,the code segment is encoded in the cookie and then the cookie istransmitted in the routine HTTP communication between the server 210 andthe client 240.

Next, the code segment encoded in the cookie is sent from the client 240to the server 220. At this point, the cookie is transmitted in theroutine HTTP communication between the client 240 and the server 220.Further, when the application 222 in the server 220 is accessed by aclient (either the client 240 or the client 242), the application 222 isexecuted based on the code segment sent to the server 220.

It would be appreciated that the path of the code segment transmittedamong the servers and clients is just an example. In another example,the path may be “the server 210→the client 242→the server 220.” In stillanother example, the path may be “the server 220→the client 240→theserver 210.”

Moreover, although descriptions are provided with one code segment as anexample, multiple code segments may be involved in the embodiment of thepresent invention. For example, a first code segment for removing thewhite spaces in the user input (as illustrated in Table 1) is providedto the server 210, and then the first code segment is provided to theserver 220 via the client 240. Further, a second code segment fordisplaying the additional message (as illustrated in Table 2) isprovided to the server 220, and then the second code segment is providedto the server 210 via the client 242.

Although only two servers are illustrated in the website in theembodiments of the present invention, the embodiments may be applied toa website including more servers. Further, more clients may be involvedin the embodiments. For example, the website may include tens of serverslocated at different city. The code segments may be first provided toone of the servers. When multiple clients access the server, the codesegments may be transmitted to the multiple clients, and then the codesegments may be transmitted from the multiple clients to the serversbeing communicating with the multiple. Further, the above procedure maybe repeated and the code segments may be transmitted to all the serversquickly.

According to embodiments of the present invention, data such as codesegment associated with common business logic may be distributed amongmultiple servers of the website in a convenient and simple mannerwithout providing a central service. With the embodiments of the presentinvention, the code segment is carried in the HTTP cookie andautomatically distributed to multiple servers according to the routineHTTP communication between the client and the servers.

Although the embodiments of the present invention are described bytaking the common business logic as the example, the shared data is notlimited to the common business logic, but may be any type of data thatis to be shared among multiple servers. For example, a commonconfiguration file may be encoded into the cookie and then distributedto the multiple servers.

Various embodiments implementing the method of the present inventionhave been described above with reference to the accompanying drawings.Those skilled in the art may understand that the method may beimplemented in software, hardware or a combination of software andhardware. Moreover, those skilled in the art may understand byimplementing steps in the above method in software, hardware or acombination of software and hardware, there may be provided anapparatus/system based on the same invention concept. Even if theapparatus/system has the same hardware structure as a general-purposeprocessing device, the functionality of software contained therein makesthe apparatus/system manifest distinguishing properties from thegeneral-purpose processing device, thereby forming an apparatus/systemof the various embodiments of the present invention. Theapparatus/system described in the present invention comprises severalmeans or modules, the means or modules configured to executecorresponding steps. Upon reading this specification, those skilled inthe art may understand how to write a program for implementing actionsperformed by these means or modules. Since the apparatus/system is basedon the same invention concept as the method, the same or correspondingimplementation details are also applicable to means or modulescorresponding to the method. As detailed and complete description hasbeen presented above, the apparatus/system is not detailed below.

According to one embodiment of the present invention, a computing systemis proposed. The computing system comprises a computer processor coupledto a computer-readable memory unit, the memory unit comprisinginstructions that when executed by the computer processor implements amethod. In the method, a code segment is obtained at a first server froma client in response to the client interacting with a first applicationhosted on the first server, where the code segment is associated withbusiness logic in the first application. Then, the first application isexecuted based on the code segment.

In one embodiment of the present invention, the first server may beassociated with a domain of a first Hyper Text Transport Protocol (HTTP)cookie, and the code segment may be obtained at the first server via thefirst HTTP cookie.

In one embodiment of the present invention, executable code may begenerated by interpreting the obtained code segment. Then, theexecutable code may be invoked in response to the first applicationbeing executed.

In one embodiment of the present invention, the code segment may bereceived via a second HTTP cookie by the client from a second serverthat hosts a second application, business logic of the secondapplication being identical to the business logic of the firstapplication.

In one embodiment of the present invention, at the first server, thecode segment may be send to a second client at the first server.

In one embodiment of the present invention, the code segment may beupdated at the first server in response to the business logic in thefirst application being changed. Then, the updated code segment may besent at the first server to a second client.

According to one embodiment of the present invention, a computer programproduct is proposed. The computer program product is tangibly stored ona non-transient machine-readable medium and comprisingmachine-executable instructions. The instructions, when executed on anelectronic device, cause the electronic device to: obtain, at a firstserver, a code segment from a client in response to the clientinteracting with a first application hosted on the first server, thecode segment being associated with business logic in the firstapplication; and execute the first application based on the codesegment.

In one embodiment of the present invention, the first server may beassociated with a domain of a first Hyper Text Transport Protocol (HTTP)cookie, and the instructions may further cause the electronic device to:receive the code segment at the first server via the first HTTP cookie.

In one embodiment of the present invention, the instructions furthercause the electronic device to: generate executable code by interpretingthe obtained code segment; and invoke the executable code in response tothe first application being executed.

In one embodiment of the present invention, the code segment may bereceived via a second HTTP cookie by the client from a second serverthat hosts a second application, and business logic of the applicationmay be identical to the business logic of the first application.

In one embodiment of the present invention, the instructions furthercause the electronic device to: send the code segment to a second clientat the first sever.

In one embodiment of the present invention, the instructions furthercause the electronic device to: update, at the first server, the codesegment in response to the business logic in the first application beingchanged; and send, at the first server, the updated code segment to asecond client.

According to one embodiment of the present invention, a computing systemis proposed. The computing system comprises a computer processor coupledto a computer-readable memory unit, the memory unit comprisinginstructions that when executed by the computer processor implements amethod. In the method, a code segment associated with business logic ofa second application is generated at a second server, where the secondapplication is hosted on the second server. Then, the code segment iscaused to be sent via a client to a first server that hosts a firstapplication, where business logic of the first application is identicalto the business logic of the second application.

In one embodiment of the present invention, the cookie may be caused tobe sent via the client to the first server according to the HTTP.

In one embodiment of the present invention, the code segment may beupdated in response to a change in the business logic of the secondapplication. Then, the updated segment may be caused to be sent to thefirst server via the client.

In one embodiment of the present invention, a third code segment to thesecond server from a client in response to the client interacting withthe second application may be obtained at the second server, where thethird code segment is associated with business logic of the secondapplication. Then, the second application in the second application maybe executed based on the third code segment.

According to one embodiment of the present invention, a computer programproduct is proposed. The computer program product is tangibly stored ona non-transient machine-readable medium and comprisingmachine-executable instructions. The instructions, when executed on anelectronic device, cause the electronic device to: generate at a secondserver a code segment associated with business logic of a secondapplication, where the second application is hosted on the secondserver; and cause the code segment to be sent via a client to a firstserver that hosts a first application, where business logic of the firstapplication is identical to the business logic of the secondapplication.

In one embodiment of the present invention, the instructions furthercause the electronic device to: encode the code segment into a HTTPcookie; and cause the HTTP cookie to be sent via the client to the firstserver.

In one embodiment of the present invention, the instructions furthercause the electronic device to: update the code segment in response to achange in the business logic of the second application; and cause theupdated segment to be sent to the first server via the client.

In one embodiment of the present invention, the instructions furthercause the electronic device to: obtain a third code segment at thesecond server from a client in response to the client interacting withthe second application, where the third code segment is associated withbusiness logic of the second application; and execute the secondapplication based on the third code segment.

Moreover, the system may be implemented by various manners, includingsoftware, hardware, firmware or a random combination thereof. Forexample, in some embodiments, the apparatus may be implemented bysoftware and/or firmware. Alternatively or additionally, the system maybe implemented partially or completely based on hardware. for example,one or more units in the system may be implemented as an integratedcircuit (IC) chip, an application-specific integrated circuit (ASIC), asystem on chip (SOC), a field programmable gate array (FPGA), etc. Thescope of the present intention is not limited to this aspect.

The present invention may be a system, an apparatus, a device, a method,and/or a computer program product. The computer program product mayinclude a computer readable storage medium (or media) having computerreadable program instructions thereon for causing a processor to carryout aspects of the present invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, or either source code or object code written in anycombination of one or more programming languages, including an objectoriented programming language such as Smalltalk, C++ or the like, andconventional procedural programming languages, such as the “C”programming language or similar programming languages. The computerreadable program instructions may execute entirely on the user'scomputer, partly on the user's computer, as a stand-alone softwarepackage, partly on the user's computer and partly on a remote computeror entirely on the remote computer or server. In the latter scenario,the remote computer may be connected to the user's computer through anytype of network, including a local area network (LAN) or a wide areanetwork (WAN), or the connection may be made to an external computer(for example, through the Internet using an Internet Service Provider).In some embodiments, electronic circuitry including, for example,programmable logic circuitry, field-programmable gate arrays (FPGA), orprogrammable logic arrays (PLA) may execute the computer readableprogram instructions by utilizing state information of the computerreadable program instructions to personalize the electronic circuitry,in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams illustrate the architecture,functionality, and operation of possible implementations of systems,methods and computer program products according to various embodimentsof the present invention. In this regard, each block in the flowchart orblock diagrams may represent a module, snippet, or portion of code,which comprises one or more executable instructions for implementing thespecified logical function(s). It should also be noted that, in somealternative implementations, the functions noted in the block may occurout of the order noted in the figures. For example, two blocks shown insuccession may, in fact, be executed substantially concurrently, or theblocks may sometimes be executed in the reverse order, depending uponthe functionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts, or combinations of special purpose hardware andcomputer instructions.

The descriptions of the various embodiments of the present inventionhave been presented for purposes of illustration, but are not intendedto be exhaustive or limited to the embodiments disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the describedembodiments. The terminology used herein was chosen to best explain theprinciples of the embodiments, the practical application or technicalimprovement over technologies found in the marketplace, or to enableothers of ordinary skill in the art to understand the embodimentsdisclosed herein.

What is claimed is:
 1. A computing system comprising a computerprocessor coupled to a computer-readable memory unit, the memory unitcomprising instructions that when executed by the computer processorimplements a method comprising: program instructions to receive from athird-party computing device, by a first server, a first code segmentassociated with business logic of a first application hosted on thefirst server in response to a client interacting with the firstapplication, wherein the first server is associated with a domain of afirst Hyper Text Transport Protocol (HTTP) cookie and with single signon (SSO) domain Hierarchy; program instructions to update the first codesegment, at the first server, in response to a change in the businesslogic of the first application; program instructions to distribute thebusiness logic among the first and a second server; program instructionsto encode the first code segment, using string code, into a first HTTPcookie using Base64 scheme by loading a Base64 into the first HTTPcookie; program instructions to generate, by the second server, a secondcode segment associated with business logic of a second applicationhosted on the second server, wherein the business logic of the firstapplication hosted on the first server is the same as the business logicof the second application hosted on the second server; programinstructions to encode the second code segment, using string code, intoa second HTTP cookie using Base64 scheme by loading a Base64 into thefirst HTTP cookie; program instructions to send, by the second server,the encoded second code segment to the first server; programinstructions to decode, by the first server, the encoded second codesegment by extracting and decoding string code, wherein the decoding isan inverse operation of the encoding the second code segment; programinstructions to execute, by the first server, the first applicationbased on the second code segment, wherein the second code segment isexecuted by a JavaScript engine at the first server in running of thefirst application; program instructions to obtain, by the second server,a third code segment from the client in response to the clientinteracting with the second application; and program instructions toexecute, by the first server, the second application based on the thirdcode segment.